{extend name="common/main"}

{block name="css"}
<style>
    .lai{
        float: none;
        display:inline-block;
    }
</style>
{/block}

{block name="body"}
<body data-type="widgets">
{include file="common/index"}
<div class="tpl-content-wrapper">
    <div class="row-content am-cf">
        <div class="row">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                <!--<h3>点数转让</h3>-->
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title  am-cf">点数充值</div>
                    </div>
                    <div class="widget-body am-fr">

                        <form class="am-form tpl-form-border-form tpl-form-border-br " id="form" >
                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">输入设备号: </label>
                                <div class="am-u-sm-3 lai">
                                    <input type="text"  name="Devid" placeholder="请输入设备号">
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">点卡号:</label>
                                <div class="am-u-sm-3 lai" >
                                    <input type="text" name="name" placeholder="请输入点卡号">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-weibo" class="am-u-sm-2">点卡密码:</label>
                                <div class="am-u-sm-3 lai" >
                                    <input type="text" name="pass" placeholder="请输入点卡密码">
                                </div>
                            </div>
                            <button type="button" onclick="roleSubmit()" class="am-btn am-btn-primary am-radius" style=" padding: .3em 1em;">确定</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
</div>
</body>
{/block}

{block name="js"}
<script type="text/javascript">

    //提交
    function roleSubmit(){
        var form=document.getElementById("form");
        var formData=new FormData(form);
        $.ajax({
            url:"{:Url('add_recharge')}",
            type:'POST',
            data:formData,
            async: false,
            cache: false,
            contentType: false, //不设置内容类型
            processData: false, //不处理数据
            success:function(res){
                if (res.code != 200) {
                    layer.msg(res.msg, {shade: 0.5, time: 2000,icon: 2});
                    return false;
                }
                layer.msg(res.msg, {shade: 0.5, time: 2000, icon: 1}, function(){
                    window.location.href=document.referrer;

                });
            }
        });
    }
</script>
{/block}